import request from "@/utils/request";
import type {RoleListResponse,GetRoleListParams} from './model/roleModel'

enum Api {
  getRoleListUrl = "/admin/acl/role/",
  saveRoleUrl = "/admin/acl/role/save",
}
// {page}/{limit}

export const getRoleListApi = ({ page, limit, roleName }:GetRoleListParams) => {
  return request.get<any, RoleListResponse>(Api.getRoleListUrl + `/${page}/${limit}`, {
    params: {
      roleName,
    },
  });
};

//添加角色
export const saveRoleApi = (roleName: string) => {
  return request.post<any, null>(Api.saveRoleUrl, { roleName });
};

